package main

import(
	"github.com/bugfan/logrus"    	
	_ "github.com/bugfan/logrus/hooks/file"
	"golang.org/x/net/websocket"				  
	"net/http"
	"os"
	"errors"
	"belt-server/com"
	"belt-server/controller"	
)


func main(){
	http.Handle("/api/ws/overview", com.MiddlewareHandler(websocket.Handler(controller.Overview)))
	run()
}
func run() {
	if len(os.Args) < 2 {
		logrus.Fatal(errors.New("缺少服务器启动参数: binary port"))
		return
	}
	logrus.Println("--启动websocket服务--")	
	logrus.Fatal(http.ListenAndServe(":"+os.Args[1], nil))
}
